Skip to content

[python] Add tag CLI subcommands#8320

Merged
JingsongLi merged 3 commits into
apache:masterfrom
TheR1sing3un:feat/python-cli-tag-commands
Jun 23, 2026
Merged

[python] Add tag CLI subcommands#8320
JingsongLi merged 3 commits into
apache:masterfrom
TheR1sing3un:feat/python-cli-tag-commands

Conversation

@TheR1sing3un

@TheR1sing3un TheR1sing3un commented Jun 22, 2026

Copy link
Copy Markdown
Member

Purpose

pypaimon already implements the full tag Catalog API (filesystem + REST), but the CLI had no way to manage tags — users had to drop down to the Python API. This adds tag management to the CLI.

Changes

Add paimon tag {create,list,get,delete} as a top-level command (alongside table / db / catalog / sql):

paimon tag create db.t v1 [--snapshot-id N] [--ignore-if-exists]
paimon tag list   db.t [--prefix P] [--format table|json]
paimon tag get    db.t v1 [--format table|json]
paimon tag delete db.t v1
  • All operations go through the Catalog layer, so they get typed exceptions (TagAlreadyExistException / TagNotExistException / TableNotExistException) and work for both filesystem and REST catalogs.
  • tag get surfaces tag_create_time / tag_time_retained when present.
  • list warns on stderr (rather than silently truncating) if the catalog returns a partial page.
  • pypaimon CLI docs updated with a new top-level "Tag Commands" section.

Flag names mirror the Java Flink/Spark tag procedures (snapshot_id, etc.).

Tests

End-to-end CLI coverage for create / list / get / delete, including --snapshot-id, --ignore-if-exists, --prefix, table/json output, and the not-found / duplicate / invalid-identifier error paths.

Does this PR introduce a user-facing change?

No.


Generative AI disclosure: drafted with AI assistance and reviewed by the author.

@JingsongLi

Copy link
Copy Markdown
Contributor

Maybe just paimon tag?

@TheR1sing3un TheR1sing3un changed the title [python] Add table tag CLI subcommands [python] Add tag CLI subcommands Jun 23, 2026
@TheR1sing3un

Copy link
Copy Markdown
Member Author

Maybe just paimon tag?

Nice suggestion. Updated~

@JingsongLi

Copy link
Copy Markdown
Contributor

Please rebase master.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

Add `paimon table tag {create,list,get,delete}` nested under the table
command (mirroring `table alter`). All operations go through the Catalog
layer so they get typed exceptions and work for both filesystem and REST
catalogs. `tag get` surfaces tag_create_time / tag_time_retained when
present. Document the new commands in the pypaimon CLI docs.
Cover create / list / get / delete end-to-end through the CLI, including
--snapshot-id, --ignore-if-exists, --prefix, table/json output, and the
not-found / duplicate / invalid-identifier error paths.
Per review, expose tags as a top-level command 'paimon tag {create,list,get,delete}'
instead of nesting under 'paimon table tag', alongside table / db / catalog / sql.
Registration moves from cli_table.add_table_subcommands to cli.main (mirroring
add_sql_subcommand); func-based dispatch is unchanged. Docs and CLI e2e tests
updated to the top-level form.
@TheR1sing3un TheR1sing3un force-pushed the feat/python-cli-tag-commands branch from 084152b to 45f0860 Compare June 23, 2026 06:12
@TheR1sing3un

Copy link
Copy Markdown
Member Author

Please rebase master.

@JingsongLi done~

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi JingsongLi merged commit 815990c into apache:master Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants